if (!jsx3.lang.Class.forName("ux.cdb.admin.mechanism.schema.SchemaWizard")) {
/**
 * Define the <code>ux.cdb.admin.mechanism.cooOrg.CooOrgInvest.builder.Builder</code> class.
 * This class inherit from <code>jsx3.gui.Dialog<code> GUI class.
 */
jsx3.Class.defineClass(
		"ux.cdb.admin.mechanism.schema.SchemaWizard",
		jsx3.gui.Dialog,
		null,
		function (objRoot) {
			/**
			 * This method will be called after UI file has deserialized.
			 */
			objRoot.prototype.isEdit=null; //the flag whether current mode is edit,come from Schema.js
			objRoot.prototype.schemaType=null;//the type of schema which will be edit,come from Schema.js
			objRoot.prototype.schemaId=null;//the id of chema which wiil be edit,come from Schema.js
			objRoot.prototype.baseinfoid=null; //baseinfo id  needed when edit
			objRoot.prototype.orgId=null;//the schema's orgid 
			objRoot.prototype.cooperAgmtDetailInfoId=null;//the detail of schema which be edit
			
			/**
			 * This method will be called after UI file has deserialized.
			 */
			objRoot.prototype.callAssistCache = function() {
				var me=this;
				
					
			}
			
			objRoot.prototype.onClose = function() {
				this.doClose();
			}
			objRoot.prototype.loadContent = function() {
				if (this.isEdit)
				{
					var type;
					/* disabled these type
					if (this.schemaType=="投融资类")
					{
						type="invest";
					}else if (this.schemaType=="小额信贷类")
					{
						type="minicredit";
					}
					else if (this.schemaType=="担保类")
					{
						type="assure";
					}
					*/
					//#for test
					this.schemaType="生源地助学贷款";
					if (this.schemaType=="生源地助学贷款")
					{
						this.schemaType="assist";
					}
					this.getDescendantOfName("windowBar").setText(ux.megatron.Main.getServer().getDynamicProperty("@cdb@Mechanism@Schema@Invest@WizardTitle@Modify"));
					this.getDescendantOfName("windowBar").repaint();
				
					 this.loadWizard(this.schemaType);
				}
				else
				{// the operation is add
					//load schema type selection
					var content=this.getDescendantOfName("blkContent");
					content.removeChildren();
					ux.megatron.Main.loadUIResourceAsync(content, "ux.cdb.admin", "ux/cdb/admin/mechanism/schema/ui/SchemaSelectType.xml", null);
					//set title
					this.getDescendantOfName("windowBar").setText(ux.megatron.Main.getServer().getDynamicProperty("@cdb@Mechanism@Schema@Invest@WizardTitle@Add"));
					this.getDescendantOfName("windowBar").repaint();
				}
			}
			//when user selected a type and click next
			objRoot.prototype.selectedType = function(){
				var selection = this.getDescendantOfName("selSchemaType");
				var orgType=null;

				 orgType=selection.getValue();
				// disable these type if ((orgType == "invest") ||(orgType=="minicredit") ||(orgType=="assure"))
				if (orgType=="assist")
				{
					this.schemaType="assist";
					this.loadWizard(this.schemaType);
					
				}
				else
				{
					this.getDescendantOfName("lblWarnmsg").setDisplay(jsx3.gui.Block.DISPLAYBLOCK,true);
				}	
	
			}
			
			//load wizard
			objRoot.prototype.loadWizard=function(type)
			{
				var content=this.getDescendantOfName("blkContent");
				var url;
				content.removeChildren();
				if (type=="invest")
				{
					url="ux/cdb/admin/mechanism/schema/invest/builder/ui/SchemaInvestBuildDialog.xml"
				}
				if (type=="minicredit")
				{
					url="ux/cdb/admin/mechanism/schema/minicredit/builder/ui/SchemaMiniCreditBuildDialog.xml"
				}
				if (type=="assure")
				{
					url="ux/cdb/admin/mechanism/schema/assure/builder/ui/SchemaAssureBuildDialog.xml"
				}
				if (type=="assist")
				{
					url="ux/cdb/admin/mechanism/schema/loanassist/builder/ui/SchemaLoanAssistBuildDialog.xml"
				}
				ux.megatron.Main.loadUIResourceAsync(content, "ux.cdb.admin", url, null);
			}
			
			objRoot.prototype.onSelected = function(){
				//hold back user select other type
				var select=this.getDescendantOfName("selSchemaType");
				if (select.getValue()=="1")
				{
					select.setValue(null);
				}
			}
			
			objRoot.prototype.onCancel = function(){
				this.doClose();
			}
			
		});
}